<template>
	<page-body>
		<view class="page">
<view class="flex benben-position-layout flex flex-wrap align-center particular_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub particular_fd0_0'>
          <view class='flex flex-wrap align-center particular_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  particular_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='particular_fd0_0_c1_c0'>详情</text>
          </view>
          <view class='flex flex-wrap align-center justify-end particular_fd0_0_c0'>
          </view>
        </view>
      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center">
				<video v-if="xcxzt==0" id="myVideo" class='flex  content_fd1_0' :src='list.wj[0].path' controls='true'
					x5-video-player-type="h5" @pause="videoEnd" :enable-progress-gesture='true' object-fit="fill"
					@timeupdate="getTimeFunc($event)" :initial-time="list.time*1"></video>
				<view class='flex flex-wrap align-center content_fd1_1'>
					<view class='flex flex-wrap align-center content_fd1_1_c0'>
						<text class='content_fd1_1_c0_c0'>内容简介</text>
					</view>

					<jyf-parser class='content_fd1_1_c1' v-if="list.nr" :html="list.nr?list.nr:''">
					</jyf-parser>
				</view>
			</view>
			<!---flex布局flex布局结束-->
		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"list": {
					"aid": "",
					"file": [],
					"content": "",
					"create_time": "",
					"time": "",
					wj:[{path:''}]
				},
				"aid": "",
				"time": "",
				xcxzt:1,//
			};
		},
		computed: {

		},
		watch: {},
		onLoad(options) {
			let {
				aid
			} = options
			if (aid !== undefined) this.aid = aid
			this.getng49a38efad9e0Func()
		},
		onUnload() {
			this.videoContext && this.videoContext.stop();
		},
		onReady() {
			this.videoContext = uni.createVideoContext('myVideo', this);
		},
		onShow() {
			this.getzt()
		},
		onHide() {
			this.videoContext && this.videoContext.stop();
		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			async getzt() {
				let info = await this.$api.get(global.apiUrls.post64534cbb2c352, {
					code: 'app_grounding_status'
				});
				console.log(info.data.data)
				// console.log(this)
				this.xcxzt = info.data.data
				// #ifndef MP-WEIXIN
				this.xcxzt=0
				//  #endif
				// this.xcxzt=0
			},
			nav() {
				this.videoEnd()
				uni.navigateBack(1)
			},
			//获取时间
			getTimeFunc(val) {
				var currentTime = parseInt(val.detail.currentTime);
				this.time = Math.floor(val.detail.currentTime);
			},
			videoEnd() {
				this.gettf49a368d75e14Func()

			},
			//添加观看时长
			async gettf49a368d75e14Func() {
				//请求方法
				//数据验证
				let data649a368d75e14 = await this.$api.post(global.apiUrls.post66e3f60f09ffb, {
					jsjnzl_id: this.aid * 1,
					time: this.time
				});

				console.log("data649a368d75e14=>", data649a368d75e14)
				if (data649a368d75e14.data.code != 1) {
					this.$message.info(data649a368d75e14.data.msg);
					return
				}
				console.log("2222222222222222222222=>", data649a368d75e14)
				let info649a368d75e14 = data649a368d75e14.data;
			},
			// /* 添加学习记录*/
			// async addRecord() {
			//   let data64910ea324123 = await this.$api.post(global.apiUrls.post64910ea324123, {
			//     means_id: this.aid,
			//     demand: this.time
			//   })
			//   console.log("触发了=>", data64910ea324123)
			//   if (data64910ea324123.data.code != 1) {
			//     this.$message.info(data64910ea324123.data.msg);
			//     return
			//   }
			// },
			//查询课程资料详情
			async getng49a38efad9e0Func() {
				//请求方法
				//数据验证

				let datalist = await this.$api.get(global.apiUrls.post66e3ebeee7841, {
					aid: this.aid
				});

				if (datalist.data.code != 1) {
					this.$message.info(datalist.data.msg);
					return
				}
				let infolist = datalist.data;
				this.list = infolist.data
				console.log("list=>", this.list)
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F6F6F6;
		background-size: 100% auto;
	}
 .particular_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }
  .particular_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }
  
  .particular_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }
  
  .particular_fd0_0_c0 {
    width: 120rpx;
  }
  
  .particular_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }
	.content_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		position: fixed;
		top: 0;
		background-size: 100% auto !important;
	}

	.content_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.content_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.content_fd0_0_c0 {
		width: 120rpx;
	}

	.content_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;

	}

	::v-deep .content_fd1_1_c1 {
		width: 100%;
		padding: 26rpx;
		background-color: #fff;
		border-radius: 16rpx;
		overflow: hidden;
	}

	.content_fd1_1_c0_c0 {
		font-size: 38rpx;
		font-weight: 500;
		color: #333;
		line-height: 50rpx;
	}

	.content_fd1_1_c0 {
		margin: 0rpx 0rpx 20rpx 0rpx;
	}

	.content_fd1_1 {
		margin: 25rpx 0rpx 0rpx 0rpx;
		width: 100%;
		padding: 0rpx 25rpx 25rpx 25rpx;
	}

	.content_fd1_0 {
		width: 750rpx;
		height: 500rpx;

		border-radius: 10rpx 10rpx 10rpx 10rpx;
	}
</style>
